Skip to main content

2.3.2 Datasets containing event information

In addition to retrieving information measured at selected dates, users may also make calculations based on events over time. E.g. one may be interested in finding individuals who got married, became unemployed, or who were unemployed for over 6 months during a given time-span. The command import-event can be used for this purpose. It performs a variable import where all records (= events) per unit (= individual) are retrieved over a specified time span. In addition to the variable name, two time-points are required in the expression: Start- and stop-date. All events that have happened between the two dates will be retrieved to your dataset, i.e. all events that overlap the time-interval. The dataset will contain a varying number of records per unit (individual) depending on how frequent change-events have occured.

Note that it is only possible to import one event-organized variable into a given dataset. One must therefore create separate datasets for each event-organized variable one needs to work with. It is still possible to connect variables with fixed information, such as e.g. gender, country of birth, date of birth or unit identifiers (personal ID etc.), using the merge command. This makes it possible to aggregate an event dataset up to a unit dataset using the collapse() command.

The import is done in the following way:

create-dataset <dataset>

import-event <variable> <start date> to <stop date> as <alias>


Example: Data matrix using import-event (time interval: 2000-01-01 - 2003-01-01)

IDStartStopVariable
1234562000-01-012000-05-301
1234562000-05-312001-12-314
1234562002-01-012003-08-152
1357912000-04-102002-03-032
1357912002-03-042002-11-113
1470362002-02-282004-07-161

Note: All events overlapping the time-period 2000-01-01 - 2003-01-01 are retrieved